package dao

import (
	"fmt"
	"github.com/jinzhu/gorm"
)

type ManualModelOm struct {
	Id              int64  `gorm:"primaryKey"`
	ModelName       string `gorm:"column:model_name;type:varchar(255)"`
	ModelNameDetail string `gorm:"column:model_name_detail;type:varchar(255)"`
	ModelYear       string `gorm:"column:model_year;type:varchar(255)"`
	BrandId         int64  `gorm:"column:brand_id;type:bigint(20)"`
}

type ManualModelOmDao struct {
	db *gorm.DB
}

func NewManualModelOmDao(db *gorm.DB) *ManualModelOmDao {
	return &ManualModelOmDao{db: db}
}

func (f *ManualModelOmDao) CreateManualModelOm(param *ManualModelOm) int64 {
	err := f.db.Create(param).Error
	if err != nil {
		fmt.Print("写入 ManualModelOm db错误", err)
	}
	return param.Id
}
